onPostPublish
Callback to receive the data published from the editor.
Usage
predis.createPost({
onPostPublish: function (error, data) {
console.log(error, data);
},
});
Parameters
Name | Description | Type | Required |
---|---|---|---|
error | Error triggered when the post failed to publish otherwise null | Error | yes |
data | The data of the published post inthe format given below. | Object | yes |
data.media_url | An array containing URL(s) of the published media. This can be a URL for a jpeg or mp4 file.In case when data.media_type is single_image or video the array will contain only one item, while in case of carousel it can contain multiple items. | Array | yes |
data.post_id | An unique ID to identify the published post. | String | yes |
data.thumb_url | An URL for the thumbnail of the published media. | String | yes |
data.media_type | Media type of the published media. Can be one of single_image , carousel or video | String | yes |
data.caption | Caption of the generated content. | String | yes |